package com.wyj.swagger.controller;

import com.wyj.swagger.pojo.Student;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName: HelloControllerapi
 * @Description: TODO
 * @author: 王亚军
 * @date: 2021/12/6  21:07
 */
@Api(tags = "hello API 服务测试",description = "对 hello 服务提供接口")
public interface HelloControllerapi {


    @GetMapping("hello")
    @ApiOperation("测试hello方法")
    String hello();

    @GetMapping
    @ApiOperation("querystring 测试方法")
    @ApiImplicitParam(name = "num",value = "学生id",required = true,dataType = "String",paramType = "query")
    Student modifyStudentNum(@RequestParam("num") String num);

    @GetMapping("{name}")
    @ApiOperation("path 测试方法")
    @ApiImplicitParam(name = "name",value = "学生姓名",required = true,dataType = "String",paramType = "path")
    Student modifyStudentName(@PathVariable("name") String name);



    @PutMapping("{id}")
    @ApiOperation("综合参数方式的测试方法")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "学生的id", required = true, dataType = "String", paramType = "path"),
            @ApiImplicitParam(name = "name", value = "学生姓名", required = true, dataType = "String", paramType = "query")
    })
    Student mofidyStudentBynNum(@PathVariable("id") String id, @RequestParam("name") String name, @RequestBody Student student);
}
